/*
 * @description: 头部描述
 * @Author: Coder
 * @Date: 2019-12-31 10:05:42
 * @LastEditors  : Coder
 */
/* 公共处理方法 */
function needList(data, chiders, value = "id") {
  data = Array.from(data);
  return data.map(item => {
    item.title = item.name;
    item.value = item[value];
    item.key = item.id;
    item.children = item[chiders];
    if (item[chiders]) needList(item[chiders], chiders, value);
    return item;
  });
}
export { needList };
